-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file type attr #328
Fix file type attr #328
Conversation
max attr is no only applicable on `date` `month` `week` `time` `datetime-local` `number` `range` input types accept attr should not be empty, when all files are accepted the attribute should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the pull request. Little change request.
Dynamic/Types/AttachmentType.php
Outdated
|
||
$options['attr']['max'] = $fileMax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this would be a bc break and would crash form themes try to read this attribute to be displayed as value on the website.
At current state we can only add a comment to // @deprecated
this and add a line to the UPGRADE.md
to remove it in the next major.
For your website you can filter out that attribute in your custom form theme if you don't want to render it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, my bad I totally forgot that use case. I added a new "data-max" attribute to allow people who have this use case to have this possibility. Should I add something to UPGRADE.md or let you handle it when you will prepare the release ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah a sentence in the UPGRADE.md would be great about it.
if (!empty($mimeTypes)) { | ||
$options['attr']['accept'] = \implode(',', $mimeTypes); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@RealAestan Thank you! |
What's in this PR?
The attribute max is removed on input type file
The attribute accept is removed when there is not restrictions on input file type
Why?
max attr is no only applicable on
date
month
week
time
datetime-local
number
range
input typesaccept attr should not be empty, when all files are accepted the attribute should be removed